#验证回文   只验证数字字母  字母不区分大小写

# 第一个
# def huiwen(str):
#     if str.isalnum():
#         if str.islower() == str[::-1].islower():
#             return True
#         else:
#             return False
#     else:
#         print("不验证除数字字母外的字符串")
#
# print(huiwen("32sdfDS23"))


#第二个
# def capicua(str):
#     if str.isalnum():
#         return str.islower()== str[::-1].islower()
#
# b=filter(capicua,"acdCa23")
# if list(b) == list(b)[::-1]:
#     print(True)
# else:
#     print(False)



#输出最小回文串
def Minhuiwen(s):
    # if s == s[::-1]:
    #     return s
    # else:
        m = 0
        res = s[::-1]
        while s[m:len(s)] != res[0:len(res)-m] and m < len(s):
            m += 1
        return s + res[len(s)-m:]
print(Minhuiwen("noo"))
print(Minhuiwen("abc"))
print(Minhuiwen("noon"))
print(Minhuiwen("nooto"))
print(Minhuiwen("oon"))
# s = noo  第二次 oo
# res = oon 第二次 oo

